; *** Solitaire, French
; *** Copyright 1998-2002 Zillions Development
; v.2.0

; You need to purchase Zillions of Games to load this rules file
; Visit the Zillions web site at http://www.zillions-of-games.com
(translate
 ("Cross" "第 1 关 - 十字")
 ("Hat" "第 2 关 - 礼帽")
 ("Octagon" "第 3 关 - 八边形")
 ("Corsair" "第 4 关 - 海盗船")
 ("Standard (Impossible)" "经典 0 - 基本摆法（无解）")
 ("The World" "经典 1 - 地球")
 ("Curate and Flock" "经典 2 - 羊圈")
 ("The Apostles" "经典 3 - 十二门徒")
 ("Triplets" "经典 4 - 四个三角")
 ("E" "经典 5 - E")
 ("Cross of St. Andrew" "经典 6 - 骰子5")
)
(define jump ($1 (verify not-empty?) capture $1 (verify empty?) add))
(define win-leaving-at
	(win-condition (Player)
        ( and (pieces-remaining 1 Marble) (absolute-config Marble ($1)) )
    )
)
(define board-defs
    (grid
        (start-rectangle 1 1 29 29) ; top-left position
        (dimensions ;7x7
            ("a/b/c/d/e/f/g" (30 0)) ; columns
            ("7/6/5/4/3/2/1" (0 30)) ; rows
		)
		(directions (n 0 -1) (e 1 0) (s 0 1) (w -1 0))
	)
    (kill-positions a1 a2 b1 a6 a7 b7 f1 g1 g2 f7 g6 g7)
)
(define standard-setup
    (board-setup
        (Player (Marble
                    a3 a4 a5
                 b2 b3 b4 b5 b6
              c1 c2 c3 c4 c5 c6 c7
              d1 d2 d3    d5 d6 d7
              e1 e2 e3 e4 e5 e6 e7
                 f2 f3 f4 f5 f6
                    g3 g4 g5 
		))
	)
)

(game
    (title "Cross")
    (solution "Solutions\Solitaire,_French\Cross.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘中心")
    (history "People have been playing solitaire for hundreds of years.  
       A French Solitaire board is shown in a 1697 engraving from the
       court of Louis XIV.\\Solitaire is also known as `Peg Solitaire`
	 because it is often played with pegs instead of marbles.")
    (strategy "Clear out areas and work towards your finishing point.  Try
       not to let a marble become stranded all by itself.  If you
       already have a stranded marble.  Try to plot its rescue!\\
       It helps to learn a few basic removal patterns: rows of three,
       2x2 and 2x3 blocks, and L-shapes.   The most complete book on all forms of
       peg solitaire is John D. Beasley's `The Ins & Outs of Peg Solitaire`.
       See the Zillions web site at http://www.zillions-of-games.com/solitaire.html
       for other suggested books.\\
       To see the solution, select `Show Solution` under the Help menu.")
    (option "prevent flipping" 2)
    (move-sound "")
    (capture-sound "Audio\\Clack.wav")
    (players Player)
    (turn-order Player)
    (board
        (image "images\Solitaire\Frenchd4.bmp")
		(board-defs)
	)
    (piece
        (image Player "images\Solitaire\Marble.bmp")
        (name Marble)
		(help "横向或纵向跳过一个相邻子并吃掉之。")
		(moves (jump n) (jump e) (jump s) (jump w))			
	)
            
    (board-setup
		(Player (Marble
                           d6      
                           d5         
                     b4 c4 d4 e4 f4   
                           d3         
                           d2      
		))
	)
    (win-leaving-at d4)
    (loss-condition (Player) stalemated)
)

(variant
    (title "Hat")
	(solution "Solutions\Solitaire,_French\Hat.zsg")
    (board-setup
        (Player (Marble
                        c7 d7 e7
						c6 d6 e6   
                        c5 d5 e5
                     b4 c4 d4 e4 f4
		))
	)
)

(variant
    (title "Octagon")
    (solution "S横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘中心")
    (board-setup
        (Player (Marble
                         a4
                   b2 b3 b4 b5 b6
                   c2 c3 c4 c5 c6
                d1 d2 d3 d4 d5 d6 d7
			 e2 e3 e4 e5 e6
                   f2 f3 f4 f5 f6
                         g4 
		))
	)
)

(variant
    (title "Corsair")
    (solution "Solutions\Solitaire,_French\Corsair.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子，且位于棋盘左上角白色的标记位置")
    (history "`La Corsaire` dates back at least to the end of the 18th century.
       It is one of ten solvable problems starting with one empty hole and
       finishing with one peg.  With the initial hole at e1, you can also play
       to finish at c1, c4, or f4, instead of c7.")
    (option "prevent flipping" true)
    (board
        (image "images\Solitaire\Frenchc7.bmp")
		(board-defs)
	)
    (board-setup
        (Player (Marble
                    a3 a4 a5
                 b2 b3 b4 b5 b6
              c1 c2 c3 c4 c5 c6 c7
              d1 d2 d3 d4 d5 d6 d7
                 e2 e3 e4 e5 e6 e7
                 f2 f3 f4 f5 f6
                    g3 g4 g5 
		))
	)
    (win-leaving-at c7)
    (loss-condition (Player) stalemated)
)

(variant (title "-")) ;---------------------------------------------------------

(variant
    (title "Standard (Impossible)")
	(solution "")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下一个棋子\\
     注意，这关是无解的！不过你可以考虑看Corsair，或者试着剩下最少的棋子。")
	(strategy "Try what you like.  There's no way to solve this!")
    (board
        (image "images\Solitaire\French.bmp")
		(board-defs)
	)
    (standard-setup)
    (win-condition (Player)(pieces-remaining 1 Marble))
    (loss-condition (Player) stalemated)
)

(variant
    (title "The World")
	(solution "Solutions\Solitaire,_French\The_World.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下21个棋子，且全部位于白色的标记位置，组成一个“地球”样式。")
    (board
        (image "images\Solitaire\FrenchWorld.bmp")
		(board-defs)
	)
    (standard-setup)
    (win-condition (Player)
        (and (pieces-remaining 21 Marble)
             (absolute-config Marble (
                        c7 d7 e7
                     b6          f6
                  a5                g5
                  a4 b4 c4 d4 e4 f4 g4
                  a3                g3
                     b2          f2
                        c1 d1 e1
             ))
        )
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Curate and Flock")
	(solution "Solutions\Solitaire,_French\Curate_and_Flock.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下17个棋子，且全部位于白色的标记位置，组成“羊圈”模样。")
    (history "This problem was originally known as `Le Lecteur au Milieu de ses Amis`,
       and first appeared in a French book of recreational mathematics in 1799.")
    (board
        (image "images\Solitaire\FrenchCurate.bmp")
		(board-defs)
	)
    (standard-setup)
    (win-condition (Player)
        (and (pieces-remaining 17 Marble)
             (absolute-config Marble (
                        a3 a4 a5
                     b2          b6
                  c1                c7
                  d1       d4       d7
                  e1                e7
                     f2          f6
                        g3 g4 g5
             ))
        )
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "The Apostles")
	(solution "Solutions\Solitaire,_French\The_Apostles.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下13个棋子，且全部位于白色的标记位置，组成12个棋子围着中心的样式")
    (board
        (image "images\Solitaire\FrenchApostles.bmp")
		(board-defs)
	)
    (standard-setup)
    (win-condition (Player)
        (and (pieces-remaining 13 Marble)
             (absolute-config Marble (
                        a3    a5
                     b2          b6
                  c1                c7
                           d4         
                  e1                e7
                     f2          f6
                        g3    g5
             ))
        )
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Triplets")
	(solution "Solutions\Solitaire,_French\Triplets.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下16个棋子，且全部位于白色的标记位置，组成四个三角形和一个正方形的样式")
    (history "`Le Tricolet` dates back at least to the end of the 18th century.")
    (board
        (image "images\Solitaire\FrenchTriplets.bmp")
		(board-defs)
	)
    (standard-setup)
    (win-condition (Player)
        (and (pieces-remaining 16 Marble)
             (absolute-config Marble (
                      a3    a5
                         b4
                c1       c4       c7
                   d2 d3    d5 d6
                e1       e4       e7
                         f4
                      g3    g5
              ))
        )
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "E")
    (solution "Solutions\Solitaire,_French\E.zsg")
    (description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下13个棋子，且全部位于白色的标记位置，组成字母E")
    (option "prevent flipping" true)
    (board
        (image "images\Solitaire\FrenchE.bmp")
		(board-defs)
	)
    (standard-setup)
    (win-condition (Player)
        (and (pieces-remaining 13 Marble)
             (absolute-config Marble (
                        c7 d7 e7
                        c6       
                        c5       
                        c4 d4 e4 
                        c3       
                        c2       
                        c1 d1 e1
              ))
        )
    )
    (loss-condition (Player) stalemated)
)

(variant
    (title "Cross of St. Andrew")
	(solution "Solutions\Solitaire,_French\Cross_of_St_Andrew.zsg")
	(description "横向或纵向跳过一个棋子吃掉它。\\
       本关目标：剩下5个棋子，且全部位于白色的标记位置，组成骰子的5点")
    (board
        (image "images\Solitaire\FrenchStAndrew.bmp")
		(board-defs)
	)
    (standard-setup)
    (win-condition (Player)
        (and (pieces-remaining 5 Marble)
             (absolute-config Marble (
                      c5    e5
                         d4         
                      c3    e3
             ))
        )
    )
    (loss-condition (Player) stalemated)
)



